package mda.annotation;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * optional class annotation to indicate what kind of persistence is used, plus the unit-name for this database.
 * If this is not used, the default JpaPersistence with unit-name = 'default'
 * @author robin
 *
 */
@Target(TYPE) 
@Retention(RUNTIME)
public @interface DatabaseUnit {
	
	/**
    * (Optional) The name of the database=unit.
    * This is the name used to select the corresponding entity manager, and appears in persistence.xml in case of JpaPersistence
    * <p> Defaults to 'default'
    */
   String name() default "default";
   
   /**
    * Optional the PersistenceType defaults to JPA
    * @return
    */
   PersistenceType type() default PersistenceType.JPA;
}
